# -*- coding: utf-8 -*-
"""
-------------------------------------------------
  File Name：   My_QLabel
  Description :
  Author :    崔术森
  Eamil  :    deer_cui@163.com
  date：     2021/11/9
-------------------------------------------------
  Change Activity:
          2021/11/9:
-------------------------------------------------
"""
__author__ = '崔术森'

from PyQt5 import QtWidgets, QtGui, QtCore


class My_QLabel(QtWidgets.QLabel):
    # 自定义e信号, 注意信号必须为类属性
    button_clicked_signal = QtCore.pyqtSignal()

    def __init__(self, parent=None):
        super(My_QLabel, self).__init__(parent)

    def mousePressEvent(self, ev: QtGui.QMouseEvent) -> None:
        self.button_clicked_signal.emit()

    # 可在外部与槽函数连接
    def connect_customized_slot(self, func):
        self.button_clicked_signal.connect(func)